import numpy as np
import platgo as pg


def naive_selection(pop: pg.Population, N: int) -> np.ndarray:
    """
    用于单目标，直接返回目标值较小的n个个体的索引
    :param pop: 待选择的种群
    :param N:  需要选择的个体数量
    :return : 返回个体索引
    """
    idx = np.argsort(pop.objv, axis=0)
    idx = np.sort(idx[:N], axis=0)
    return idx
